﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;

namespace CoreEx.Common.Extensions
{
    public static class AssemblyExtensions
    {
        /// <summary>
        /// Returns the location on the <paramref name="assembly"/>
        /// </summary>
        /// <param name="assembly">The <see cref="Assembly"/> for witch to get the directory name.</param>
        /// <returns>The loacl representation of the assembly location.</returns>
        public static string GetDirectory(this Assembly assembly)
        {
            return Path.GetDirectoryName(new Uri(assembly.CodeBase).LocalPath);            
        }
            
    }
}
